package sft.Autenticacao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import sft.BancodeDados.CriaConexao;

public class loginNovo {
    
    private static Connection conexao;
    
    public loginNovo() throws SQLException {
        loginNovo.conexao = new CriaConexao().getConnection();
    }
    
    public void alterar() throws SQLException {
        String sql = "update sft_usua set usua_sn_snusua=? where usua_id_idusua like ?";
        try (PreparedStatement stmt = conexao.prepareStatement(sql)) {
            stmt.setString(1, Sessao.getInstance().getUsuario().getSenha());
            stmt.setInt(2, Sessao.getInstance().getUsuario().getId());

            stmt.execute();
            stmt.close();
        }
    }
}
